package com.springaop.service.advice;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class MyAspect implements MethodInterceptor {

    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        before();
        Object proceed = invocation.proceed();
        after();
        return proceed;
    }
    public void before(){
        System.out.println("MyAspect.before方法执行前");
    }
    public void after(){
        System.out.println("MyAspect.after方法执行后");
    }
}
